<?php

namespace RSP\ReseauSocialBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Pays
 *
 * @ORM\Table()
 * @ORM\Entity
 */

class Pays
{
    
    /**
     * @ORM\OneToMany(targetEntity="RSP\ReseauSocialBundle\Entity\Ville",mappedBy="pays")
     *@ORM\joinColumn(nullable=false)
     */
     private $villes;
    /**
     * @ORM\OneToMany(targetEntity="RSP\UserBundle\Entity\User",mappedBy="pays")
     *@ORM\joinColumn(nullable=false)
     */
     private $users;
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="nom", type="string", length=255)
     */
    private $nom;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nom
     *
     * @param string $nom
     * @return Pays
     */
    public function setNom($nom)
    {
        $this->nom = $nom;
    
        return $this;
    }

    /**
     * Get nom
     *
     * @return string 
     */
    public function getNom()
    {
        return $this->nom;
    }
    /**
     * Constructor
     */
    public function __construct()
    {
        $this->villes = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add villes
     *
     * @param \RSP\ReseauSocialBundle\Entity\Ville $villes
     * @return Pays
     */
    public function addVille(\RSP\ReseauSocialBundle\Entity\Ville $villes)
    {
        $this->villes[] = $villes;
    
        return $this;
    }

    /**
     * Remove villes
     *
     * @param \RSP\ReseauSocialBundle\Entity\Ville $villes
     */
    public function removeVille(\RSP\ReseauSocialBundle\Entity\Ville $villes)
    {
        $this->villes->removeElement($villes);
    }

    /**
     * Get villes
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getVilles()
    {
        return $this->villes;
    }
    public function __toString() {
        return $this->nom;
    }

    /**
     * Add users
     *
     * @param \RSP\UserBundle\Entity\User $users
     * @return Pays
     */
    public function addUser(\RSP\UserBundle\Entity\User $users)
    {
        $this->users[] = $users;
    
        return $this;
    }

    /**
     * Remove users
     *
     * @param \RSP\UserBundle\Entity\User $users
     */
    public function removeUser(\RSP\UserBundle\Entity\User $users)
    {
        $this->users->removeElement($users);
    }

    /**
     * Get users
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getUsers()
    {
        return $this->users;
    }
}